package com.design.responsibility.demo1;

public class ChainOfResponsibilityDemo {
    public static void main(String[] args) {
        PaymentProcessor paypalProcessor = new PayPalProcessor();
        PaymentProcessor creditCardProcessor = new CreditCardProcessor();
        PaymentProcessor bankTransferProcessor = new BankTransferProcessor();

        paypalProcessor.setNextProcessor(creditCardProcessor);
        creditCardProcessor.setNextProcessor(bankTransferProcessor);

        paypalProcessor.processPayment(50);
        paypalProcessor.processPayment(200);
        paypalProcessor.processPayment(1500);
    }
}
